package com.pf.commom.exception;

import com.pf.commom.enums.BaseResultEnum;
import lombok.Getter;

/**
 * @author PanFei
 * @version 1.0.0
 * @createTime 2021/8/27
 */
public class BusinessException extends RuntimeException {

    @Getter
    private Integer code;

    public BusinessException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }

    public BusinessException(BaseResultEnum baseResultEnum) {
        super(baseResultEnum.getMsg());
        this.code = baseResultEnum.getCode();
    }
}
